﻿using Estsh.Core.Base;
using Estsh.Core.Model.EnumUtil;
using Estsh.Core.Models;
using Estsh.Core.Repositories;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Estsh.Core.Wms.IRepositories
{
    public interface IOutPdlineRepository : IBaseRepository<BaseEntity>
    {
        public List<MesWmsOutPdline> GetFinishedLineOffInfo();

        /// <summary>
        /// 成品下线 处理成品和半成品下线
        /// </summary>
        /// <param name="sapCu"></param>
        /// <returns></returns>
        public bool InsertFinishedLineOffInfo(List<MesWmsOutPdline> mesWmsOuts);

        /// <summary>
        /// 获取待处理的下线报工数据
        /// </summary>
        /// <returns></returns>
        List<MesOutPdline> GetOutPdlineInfo();
        /// <summary>
        /// 更新下线数据
        /// </summary>
        /// <param name="outPdline"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        int UpdateOutPdlineInfo(MesOutPdline outPdline,
            MesEnumUtil.OutPdlineReportStatus status, string msg = "");

        /// <summary>
        /// 处理下线报工
        /// </summary>
        /// <param name="outPdline"></param>
        /// <param name="bomDetails"></param>
        /// <param name="pdline"></param>
        /// <returns></returns>
        bool DoOutPdline(MesOutPdline outPdline,
            List<SysBomDetail> bomDetails, SysPdline pdline);
    }
}
